//===== eAthena Script =======================================
//= ]M
//===== By: ==================================================
//= acky - god@acky.com
//===== Current Version: =====================================
//= 1.1.5
//===== Compatible With: =====================================
//= eAthena SVN
//===== Description: =========================================
//= Players train monsters and battle other players.
//= Experience can be earned and monsters upgraded.
//===== Additional Comments: =================================
//= To add monsters, add lines after the commends labled:
//= '// #. ---Change to Add Monsters--- //'
//= There are 6 steps to add a monster at the moment.
//= Added Duel Room
//= ---------------------------------------------------------
//= Script is messy! Be careful!
//= 1.1.2 Changed all gmcommand to atcommand as Poki#3 suggested. [Vicious]
//= 1.1.3 Removed Duplicate Names [Silent]
//= 1.1.4 Fixed SummonPad syntax. [KarLaeda]
//= 1.1.5 Some cleanup & optimization [KarLaeda]
//= ---------------------------------------------------------
//= }
//= u@ë 2006/02/08
//============================================================ 

// Entrance //
prontera,164,109,6	script	]M޲zH	702,{
mes "[]M޲zH]";
mes "wӨ]M!";
mes "e ^FF0000" + getmapusers("gon_test") + "^000000 Wa";
mes "^FF0000`N:^000000 jL,NM\aJ!";
L_Menu:
next;
menu "iJ",-,"]޳",L_Info,"",L_Exit;

set @marena,1;
savepoint "gon_test",56,99;
set @battle,0;
warp "gon_test",57,99;
close;

L_Exit:
mes "[]M޲zH]";
mes "Hw.";
close;

L_Info:
mes "[]M޲zH]";
mes "A乥ivRݩA].";
next;
mes "[]M޲zH]";
mes "MiDݭAܧ.";
next;
mes "[]M޲zH]";
mes "PK|lA].";
mes "A]b԰,AbMP@nMiJ[u.";
next;
mes "[]M޲zH]";
mes "]VmviHvA].";
next;
mes "[]M޲zH]";
mes "ϥΤk,@ϥ@hLA]v¡F.";
next;
mes "[]M޲zH]";
mes "A]Vh, NiHohghA]ɯ.";
next;
mes "[]M޲zH]";
mes "]Vj, Alꪺɶ]NV.";

goto L_Menu;
}

// Monster Summon Function //
function	script	monstersummon	{
// 1. ---Change to Add Monsters--- //
if (#monster == 10) summon strcharinfo(0) + "iQ",1002, "OnporingKilled";
if (#monster == 20) summon strcharinfo(0) + "",1007, "OnFaberKilled";
if (#monster == 30) summon strcharinfo(0) + "ƨ",1063, "OnLunaticKilled";
if (#monster == 31) summon strcharinfo(0) + "giQ",1113, "OnDropsKilled";
if (#monster == 32) summon strcharinfo(0) + "p",1049, "OnPickyKilled";
if (#monster == 40) summon strcharinfo(0) + "a",1011, "OnChonChonKilled";
if (#monster == 41) summon strcharinfo(0) + "Jߤp",1050, "OnSPickyKilled";
if (#monster == 42) summon strcharinfo(0) + "",1010, "OnWillowKilled";
if (#monster == 50) summon strcharinfo(0) + "ùF",1012, "OnRodaKilled";
if (#monster == 51) summon strcharinfo(0) + "rN",1009, "OnCondorKilled";
if (#monster == 60) summon strcharinfo(0) + "s",1051, "OnThiefKilled";
if (#monster == 70) summon strcharinfo(0) + "p",1167, "OnSavageKilled";
if (#monster == 80) summon strcharinfo(0) + "l彿",1005, "OnFamiliarKilled";
if (#monster == 81) summon strcharinfo(0) + "L",1004, "OnHornetKilled";
if (#monster == 90) summon strcharinfo(0) + "FzT",1107, "OnPuppyKilled";
if (#monster == 91) summon strcharinfo(0) + "r",1014, "OnSporeKilled";
if (#monster == 92) summon strcharinfo(0) + "nu",1052, "OnRockerKilled";
if (#monster == 100) summon strcharinfo(0) + "eԤh",1076, "OnSkeletonKilled";
if (#monster == 101) summon strcharinfo(0) + "}B",1161, "OnPlanktonKilled";
if (#monster == 102) summon strcharinfo(0) + "cѤ",1247, "OnAntonioKilled";
if (#monster == 103) summon strcharinfo(0) + "Bǵs",1017, "OnThiefFemaleKilled";
close;
}

// Referee //
-	script	monsterreferee	61,{
if (@fighting == 1) end;
if (@battle == 1) goto L_Start;
end;

L_Start:
mes "[refree]";
mes "A]O:";

// 2. ---Change to Add Monsters--- //
if (#monster == 10) mes "iQ";
if (#monster == 20) mes "";
if (#monster == 30) mes "ƨ";
if (#monster == 31) mes "giQ";
if (#monster == 32) mes "p";
if (#monster == 40) mes "a";
if (#monster == 41) mes "Jߤp";
if (#monster == 42) mes "";
if (#monster == 50) mes "ùF";
if (#monster == 51) mes "rN";
if (#monster == 60) mes "s";
if (#monster == 70) mes "p";
if (#monster == 80) mes "l彿";
if (#monster == 81) mes "L";
if (#monster == 90) mes "FzT";
if (#monster == 91) mes "r";
if (#monster == 92) mes "nu";
if (#monster == 100) mes "eԤh";
if (#monster == 101) mes "}B";
if (#monster == 102) mes "eѤ";
if (#monster == 103) mes "Bǵs";

mes "An}l԰F?";
next;
menu "}la",-,"",L_Exit;

set @fighting,1;
set #heal,1;
set @special,rand (100); // Chance of special summon
if (@special == 1) goto Special1;
if (@special == 2) goto Special2;
if (@special == 3) goto Special3;
if (@special == 4) goto Special4;
if (@special == 5) goto Special5;

callfunc "monstersummon";
close;

// Special Summons //
Special1:
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
summon strcharinfo(0) + "",1002, "OnporingKilled";
close;

Special2:
summon strcharinfo(0) + "iQ",1090, "OnSpecialKilled";
close;

Special3:
summon strcharinfo(0) + "ƨߤ",1093, "OnSpecialKilled";
close;

Special4:
summon strcharinfo(0) + "s",1091, "OnSpecialKilled";
close;

Special5:
summon strcharinfo(0) + "",1089, "OnSpecialKilled";
close;

L_Exit:
mes "[refree]";
mes "na";
close;
}
gon_test,56,91,6	duplicate(monsterreferee)	Referee#01	61


//  //
gon_test,58,94,6	script		86,{
set @marena,1;
mes "[]";
mes "AQn?";
next;
menu "^0000FFh[u^000000",L_Spec,"^FF0000ǳƧ^000000",-,"^",L_Exit,"",L_Cancel;

if (#monster == 0) goto L_NoMon;
if (#heal == 1) goto L_Heal;

if (#monster < 40) goto L_Low;
if (#monster > 30 && #monster < 80) goto L_Med;
if (#monster > 70) goto L_High;

L_Low:
menu "1-3",L_1to3,"^FF0000C",L_High;
close;

L_Med:
menu "4-7",L_4to6,"^FF0000",L_High;
close;

L_High:
close2;
savepoint "gon_test",56,99;
set @battle,1;
atcommand strcharinfo(0) + "@option 64 0 64";
warp "gon_test",72,87;
end;

L_4to6:
close2;
savepoint "gon_test",56,99;
set @battle,1;
atcommand strcharinfo(0) + "@option 64 0 64";
warp "gon_test",57,86;
end;

L_1to3:
close2;
savepoint "gon_test",56,99;
set @battle,1;
atcommand strcharinfo(0) + "@option 64 0 64";
warp "gon_test",43,87;
end;

L_Exit:
close2;
savepoint "prontera",149,186;
set @battle,0;
atcommand strcharinfo(0) + "@option 0 0 0";
warp "prontera",149,186;
end;

L_Spec:
close2;
savepoint "gon_test",56,99;
set @battle,0;
atcommand strcharinfo(0) + "@option 0 0 0";
warp "gon_test",57,99;
end;

L_NoMon:
mes "[]";
mes "A٨So],uiJ[u.";
close;

L_Heal:
mes "[]";
mes "AA]v쥦iH԰.";
close;

L_Cancel:
close;
}

// ]Vmv //
gon_test,52,103,6	script	]Vmv	87,{
mes "[]Vmv]";
if (#monster != 0) goto L_Mon;

mes "wӨ]޳, Oӿ]??";
next;
menu "O",-,"",L_Exit;

mes "[]Vmv]";
mes "sӪuiHΪiQ.";
mes "O1000z,AnʶR?";
next;
menu "n",-,"n",L_Exit;

if (zeny < 1000) goto L_NoZeny;
set zeny,zeny-1000;
set #monster,10;
mes "[]Vmv]";
mes "ߧA!";
mes "AiQo쨬hg,AiHڬLɯ.";
close;

L_Mon:
mes "wA, " + strcharinfo(0) + ".";
mes "A] " + #monpoints + " g.";
next;
if (@fighting == 1) goto L_Heal;
menu "ɯ]",L_Upgrade,"g",L_Sell,"^FF0000]^000000",L_Abandon,"",L_Exit;

L_Abandon:
mes "[]Vmv]";
mes "ATwnA]?";
next;
menu "O",-,"",L_Exit;
set #monster,0;
set #monpoints,0;
mes "[]Vmv]";
mes "]wgQ.";
close;

L_Sell:
mes "[]Vmv]";
mes "]C@Ig紫100z.";
next;
menu "g",-,"",L_Exit;
mes "[]Vmv]";
mes "A: ^FF0000" + #monpoints + "^000000 g";
mes "Qh?";
next;
input @sellexp;
if (@sellexp > #monpoints) goto L_NoExp;
set #monpoints,#monpoints-@sellexp;
set @sellearn,100*@sellexp; // g
set zeny,zeny+@sellearn;
mes "[]Vmv]";
mes "AoF ^0000FF" + @sellearn + "^000000z.";
close;


L_NoExp:
mes "[]Vmv]";
mes "ASg.";
next;
goto L_Exit;

// ]ɯ //
L_Upgrade:
mes "[]Vmv]";
// 3. ---Change to Add Monsters - May not be required--- //
if (#monster > 1 && #monster < 20) mes "Aݭn 10 IgȤɯŧA].";
if (#monster > 19 && #monster < 30) mes "Aݭn 20 IgȤɯŧA].";
if (#monster > 29 && #monster < 40) mes "Aݭn 40 IgȤɯŧA].";
if (#monster > 39 && #monster < 50) mes "Aݭn 80 IgȤɯŧA].";
if (#monster > 49 && #monster < 60) mes "Aݭn 160 IgȤɯŧA].";
if (#monster > 59 && #monster < 70) mes "Aݭn 320 IgȤɯŧA].";
if (#monster > 69 && #monster < 80) mes "Aݭn 640 IgȤɯŧA].";
if (#monster > 79 && #monster < 90) mes "Aݭn 1280 IgȤɯŧA].";
if (#monster > 89 && #monster < 100) mes "Aݭn 2560 IgȤɯŧA].";
next;
menu "~",-,"",L_Exit;
mes "[]Vmv]";

// 4. ---Change to Add Monsters - May not be required--- //
if (#monster > 1 && #monster < 20 && #monpoints > 9) goto L_Up1;
if (#monster > 19 && #monster < 30 && #monpoints > 19) goto L_Up2;
if (#monster > 29 && #monster < 40 && #monpoints > 39) goto L_Up3;
if (#monster > 39 && #monster < 50 && #monpoints > 79) goto L_Up4;
if (#monster > 49 && #monster < 60 && #monpoints > 159) goto L_Up5;
if (#monster > 59 && #monster < 70 && #monpoints > 319) goto L_Up6;
if (#monster > 69 && #monster < 80 && #monpoints > 639) goto L_Up7;
if (#monster > 79 && #monster < 90 && #monpoints > 1279) goto L_Up8;
if (#monster > 89 && #monster < 100 && #monpoints > 2559) goto L_Up9;

mes "Lkɯ.";
close;

// 5. ---Change to Add Monsters--- //
	L_Up1:
	set #monster,20;
	set #monpoints,#monpoints-10;
	mes "ɯŨ!";
	close;

	L_Up2:
	mes "AQɯŦ]?";
	next;
	menu "ƨ",U_Lunatic,"giQ",U_Drops,"p",U_Picky;

		U_Drops:
		set #monster,31;
		set #monpoints,#monpoints-20;
		mes "[]Vmv]";
		mes "ɯŨgiQ!";
		close;

		U_Picky:
		set #monster,32;
		set #monpoints,#monpoints-20;
		mes "[]Vmv]";
		mes "ɯŨp!";
		close;

		U_Lunatic:
		set #monster,30;
		set #monpoints,#monpoints-20;
		mes "[]Vmv]";
		mes "ɯŨƨ!";
		close;

	L_Up3:
	mes "AQɯŦ]?";
	next;
	menu "a",U_ChonChon,"Jߤp",U_SPicky,"",U_Willow;

		U_ChonChon:
		set #monster,40;
		set #monpoints,#monpoints-40;
		mes "[]Vmv]";
		mes "ɯŨa!";
		close;

		U_SPicky:
		set #monster,41;
		set #monpoints,#monpoints-40;
		mes "[]Vmv]";
		mes "ɯŨJߤp!";
		close;

		U_Willow:
		set #monster,42;
		set #monpoints,#monpoints-40;
		mes "[]Vmv]";
		mes "ɯŨ!";
		close;

	L_Up4:
	mes "AQɯŦ]?";
	next;
	menu "rN",U_Condor,"ùF",U_Roda;

		U_Condor:
		set #monster,51;
		set #monpoints,#monpoints-80;
		mes "[]Vmv]";
		mes "ɯŨrN!";
		close;

		U_Roda:
		set #monster,50;
		set #monpoints,#monpoints-80;
		mes "[]Vmv]";
		mes "ɯŨùF!";
		close;

	L_Up5:
	set #monster,60;
	set #monpoints,#monpoints-160;
	mes "ɯŨs!";
	close;

	L_Up6:
	set #monster,70;
	set #monpoints,#monpoints-320;
	mes "ɯŨp!";
	close;

	L_Up7:
	mes "AQɯŦ]?";
	next;
	menu "l彿",U_Familiar,"L",U_Hornet;

		U_Hornet:
		set #monster,81;
		set #monpoints,#monpoints-640;
		mes "[]Vmv]";
		mes "ɯŨL!";
		close;

		U_Familiar:
		set #monster,80;
		set #monpoints,#monpoints-640;
		mes "[]Vmv]";
		mes "ɯŨl彿!";
		close;

	L_Up8:
	mes "[]Vmv]";
	mes "AQɯŦ]?";
	next;
	menu "FzT",U_Puppy,"r",U_Spore,"nu",U_Rocker;

		U_Spore:
		set #monster,91;
		set #monpoints,#monpoints-1280;
		mes "[]Vmv]";
		mes "ɯŨr!";
		close;

		U_Rocker:
		set #monster,92;
		set #monpoints,#monpoints-1280;
		mes "[]Vmv]";
		mes "ɯŨnu!";
		close;

		U_Puppy:
		set #monster,90;
		set #monpoints,#monpoints-1280;
		mes "[]Vmv]";
		mes "ɯŨFzT!";
		close;

	L_Up9:
	mes "AQɯŦ]?";
	next;
	menu "eԤh",U_Skeleton,"cѤ",U_Antonio,"}B",U_Plankton,"Bǵs",U_ThiefFemale;

		U_Plankton:
		set #monster,101;
		set #monpoints,#monpoints-2560;
		mes "[]Vmv]";
		mes "ɯŨ}B!";
		close;

		U_Antonio:
		set #monster,102;
		set #monpoints,#monpoints-2560;
		mes "[]Vmv]";
		mes "ɯŨ쨸cѤ!";
		close;

		U_ThiefFemale:
		set #monster,103;
		set #monpoints,#monpoints-2560;
		mes "[]Vmv]";
		mes "ɯŨBǵs!";
		close;

		U_Skeleton:
		set #monster,100;
		set #monpoints,#monpoints-2560;
		mes "[]Vmv]";
		mes "ɯŨ쨸eԤh!";
		close;

L_NoZeny:
mes "[]Vmv]";
mes "A!";
close;

L_Exit:
mes "[]Vmv]";
mes "A.";
close;

L_Heal:
mes "[]Vmv]";
mes "A]ݭnv.";
mes "pGAI@hܥ_|.";
set #heal,1;
close;
}

// Kill Trigger //
// 6/Final. ---Change to Add Monsters--- //
gon_test,56,91,6	script	OnPoringKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+1;
	announce "AF1 iQ - o 1 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnFaberKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+2;
	announce "AF1  - o 2 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnLunaticKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+4;
	announce "AF1 ƨ - o 4 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnDropsKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+4;
	announce "AF1 giQ - o 4 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnPickyKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+4;
	announce "AF1 p - o 4 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnChonChonKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+8;
	announce "AF1 a - o 8 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnSPickyKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+8;
	announce "AF1 Jߤp - o 8 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnWillowKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+8;
	announce "AF1  - o 8 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnRodaKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+16;
	announce "AF1 ùF - o 16 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnCondorKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+16;
	announce "AF1 rN - o 16 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnThiefKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+32;
	announce "AF1 s - o 32 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnSavageKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+64;
	announce "AF1 p - o 64 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnFamiliarKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+128;
	announce "AF1 l彿 - o 128 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnHornetKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+128;
	announce "AF1 L - o 128 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnPuppyKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+256;
	announce "AF1 FzT - o 256 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnRockerKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+256;
	announce "AF1 nu - o 256 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnSporeKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+256;
	announce "AF1 r - o 256 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnSkeletonKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+512;
	announce "AF1 eԤh - o 512 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnPlanktonKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+512;
	announce "AF1 }B - o 512 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnAntonioKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+512;
	announce "AF1 cѤ - o 512 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnThiefFemaleKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+512;
	announce "AF1 Bǵs - o 512 g",19;
	callfunc "duelkill";
}

gon_test,56,91,6	script	OnSpecialKilled	-1,{
	if (@marena == 0) callfunc "illegalkill";
	set #monpoints,#monpoints+512;
	announce "AF1 S] - o 1024 g",19;
	callfunc "duelkill";
}

function	script	duelkill	{
if (strcharinfo(0) == $@duelist1$ || strcharinfo(0) == $@duelist2$) goto L_Heal;
end;
	L_Heal:
	announce strcharinfo(0) + " ĹoM!",1;
	set @fighting,0;
	set #heal,0;
	set @healing,0;
	end;
}

function	script	illegalkill	{
announce "˴ " + strcharinfo(0) + " Dk",1;
percentheal -100,-100;
end;
}

// Healer //
gon_test,55,103,6	script	@h	90,{
if (@battle == 1 || #heal == 0) goto L_NoHeal;
if (#heal == 1 && @healing < 100) goto L_Heal; //Total healing required
set @fighting,0;
set #heal,0;
set @healing,0;
specialeffect2 364;
announce "A]wgv¡.",19;
end;

	L_Heal:
	set @healrate,140 / #monster; //Rate of heal per click
	set @healing,@healing + @healrate;
	end;

	L_NoHeal:
	announce "A]|v¡.",19;
	end;
}

// Warps players //
gon_test,57,86,5	script	Summon Pad 1::SummonPad	111,2,2,{
end;
OnTouch:
set @marena,1;
warp "gon_test",57,99;
}
gon_test,43,87,5	duplicate(SummonPad)	Summon Pad 2	111,2,2
gon_test,72,87,5	duplicate(SummonPad)	Summon Pad 3	111,2,2



// Skill Disabler //
gon_test,57,99,5	script	Skill Disable	111,3,3,{
atcommand strcharinfo(0) + "@skilloff";
disablenpc "Skill Disable";
end;
}

// Duel Arena //
gon_test,58,103,5	script	Mjv#01	92,{
if ($@duelist1$ == "") set @duel,0;
if ($@monster1 == "") set @duel,0;
set @marena,1;
if (#monster == 0) goto L_NoMon;
mes "[Mjv]";
if ($@duel == 1) goto L_Waiting;
if ($@duel == 2) goto L_Dueling;

mes "eSaM.";
next;
menu "ѥ[",-,"iJ[u",L_Spec,"",L_Exit;

// Player 1 Enters Duel Area //
if (#heal == 1) goto L_NeedHeal;
if ($@duel == 1) goto L_Duel2;
set $@duel,1;
if (#monster > 1 && #monster < 20) set $@monster1,1;
if (#monster > 19 && #monster < 30) set $@monster1,2;
if (#monster > 29 && #monster < 40) set $@monster1,3;
if (#monster > 39 && #monster < 50) set $@monster1,4;
if (#monster > 49 && #monster < 60) set $@monster1,5;
if (#monster > 59 && #monster < 70) set $@monster1,6;
if (#monster > 69 && #monster < 80) set $@monster1,7;
if (#monster > 79 && #monster < 90) set $@monster1,8;
if (#monster > 89 && #monster < 100) set $@monster1,9;
if (#monster > 99 && #monster < 110) set $@monster1,10;
set $@duelist1$,strcharinfo(0);
set @battle,1;
announce strcharinfo(0) + " []: " + $@monster1 + "] bݨM",1;
atcommand strcharinfo(0) + "@option 64 0 64";
warp "gon_test",49,5;
close;

L_Waiting:
mes "^0000FF " + $@duelist1$ + "^000000 []: ^FF0000" + $@monster1 + "^000000]";
mes "еݹ";
next;
menu "ѥ[",-,"iJ[u",L_Spec,"",L_Exit;

// Player 2 Enters Duel Area //
if (#heal == 1) goto L_NeedHeal;
L_Duel2:
if ($@duel == 2) goto L_Spec;
set $@duel,2;
if (#monster > 1 && #monster < 20) set $@monster2,1;
if (#monster > 19 && #monster < 30) set $@monster2,2;
if (#monster > 29 && #monster < 40) set $@monster2,3;
if (#monster > 39 && #monster < 50) set $@monster2,4;
if (#monster > 49 && #monster < 60) set $@monster2,5;
if (#monster > 59 && #monster < 70) set $@monster2,6;
if (#monster > 69 && #monster < 80) set $@monster2,7;
if (#monster > 79 && #monster < 90) set $@monster2,8;
if (#monster > 89 && #monster < 100) set $@monster2,9;
if (#monster > 99 && #monster < 110) set $@monster2,10;
set $@duelist2$,strcharinfo(0);
set @battle,1;
announce strcharinfo(0) + " []: " + $@monster2 + "] wg[JM",1;
atcommand strcharinfo(0) + "@option 64 0 64";
warp "gon_test",49,5;
close;

	L_Dueling:
	mes "^0000FF" + $@duelist1$ + "^000000 []: ^0000FF" + $@monster1 + "^000000]";
	mes "           VS.";
	mes "^FF0000" + $@duelist2$ + "^000000 []: ^FF0000" + $@monster2 + "^000000]";
	next;
	menu "iJ[u",L_Spec,"",L_Exit;
	
	L_Spec:
	set @battle,0;
	atcommand strcharinfo(0) + "@option 64 0 64";
	warp "gon_test",49,5;
	close;

	L_Exit:
	mes "[Mjv]";
	mes "A.";
	close;

	L_NoMon:
	mes "[Mjv]";
	mes "AS],Aѥ[.";
	close;

	L_NeedHeal:
	mes "[Mjv]";
	mes "AvA].";
	close;
}

// Duel Exit //
gon_test,42,8,5	script	Mjv#02	92,{
mes "[Mjv]";
mes "AQ^h?";
menu "O",L_Leave,"",-;
mes "na";
close;

	L_Leave:
	if ($@duelist1$ == strcharinfo(0)) goto L_Leave1;
	if ($@duelist2$ == strcharinfo(0)) goto L_Leave2;

		L_Leave3:
		atcommand strcharinfo(0) + "@option 0 0 0";
		set @battle,0;
		warp "gon_test",57,99;
		close;

		L_Leave1:
		set $@duelist1$,$@duelist2$;
		set $@monster1,$@monster2;
		set $@duel,$@duel-1;
		announce strcharinfo(0) + " M",1;
		goto L_Leave3;

		L_Leave2:
		set $@duelist2$,"";
		set $@monster2,0;
		set $@duel,$@duel-1;
		announce strcharinfo(0) + " M",1;
		goto L_Leave3;
}

gon_test,49,5,5	duplicate(SummonPad)	Summon Pad 4	111,2,2
gon_test,55,8,6	duplicate(monsterreferee)	Referee#02	61